﻿using J.CustomerModel;
using J.CustomerRepository.Impl;
using J.CustomerRepository.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CustomerService
{
    public class MemberCardService:IMemberCardService
    {
        private readonly IMemberCardRepository cardRepository;
        public MemberCardService(IMemberCardRepository cardRepository)
        {
            this.cardRepository = cardRepository;
        }
        /// <summary>
        /// 会员卡添加
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>

        public async Task<int> MemberCardAdd(MemberCard model)
        {
            return await cardRepository.AddAsync(model);
        }
        /// <summary>
        /// 会员卡详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public async Task<MemberCard> MemberDetail(int id)
        {
            return await cardRepository.GetModelAsync(id);
        }
    }   
}
